/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2023 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __OC_RSRC_CFG_H_
#define __OC_RSRC_CFG_H_

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32h7xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stdio.h>
#include <stdint.h>
#include <string.h>
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define SD_DETECT_Pin GPIO_PIN_5
#define SD_DETECT_GPIO_Port GPIOD
#define LED_R_Pin GPIO_PIN_15
#define LED_R_GPIO_Port GPIOC
#define U4_RX_Pin GPIO_PIN_9
#define U4_RX_GPIO_Port GPIOI
#define LED_B_Pin GPIO_PIN_8
#define LED_B_GPIO_Port GPIOI
#define U4_TX_Pin GPIO_PIN_0
#define U4_TX_GPIO_Port GPIOA
#define SPI1_NSS_Pin GPIO_PIN_4
#define SPI1_NSS_GPIO_Port GPIOA

/* USER CODE BEGIN Private defines */

typedef struct HW_BUF_ATTR_STR
{
    uint8_t * buf;
    uint32_t  len;
} hw_buf_attr;

typedef struct HW_ADDR_ATTR_STR
{
    uint32_t addr;
    uint32_t len;
} hw_addr_attr;

typedef enum
{
  HW_TRUE  = 0,
  HW_FALSE = 1,
} HW_STATUS;

enum 
{
    TRANSFER_WAIT,
    TRANSFER_COMPLETE,
    TRANSFER_ERROR
};

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __OC_RSRC_CFG_H_ */
